<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('完整性要素设置')"/>
</head>
<body class="gray-bg">
<div class="row">
    <div class="col-sm-12">
        <div class="tabs-container">
            <ul class="nav nav-tabs">
                <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 破坏</a>
                </li>
                <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">盗窃/抢夺</a>
                </li>
            </ul>
            <div class="tab-content">
                <div id="tab-1" class="tab-pane active">
                    <div class="panel-body">
                        <div class="container-div">
                            <div class="row">
                                <div class="col-sm-12 search-collapse">
                                    <form id="formId1">
                                        <div class="select-list">
                                            <ul>

                                                <li>
                                                    <input type="text" placeholder="请输入要素名称" name="aCname"/>
                                                </li>
                                                <!--<li>
                                                    <p>创建时间：</p>
                                                    <input name="params[aTime]" readonly data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" placeholder="" class="form-control time-input-two" type="text" required>
                                                </li>-->
                                                <li>
                                                    <a class="btn btn-primary btn-rounded btn-sm"
                                                       onclick="$.table.search('formId1', 'bootstrap-table1')"><i
                                                            class="fa fa-search"></i>&nbsp;搜索</a>
                                                    <a class="btn btn-warning btn-rounded btn-sm"
                                                       onclick="$.form.reset('formId1', 'bootstrap-table1')"><i
                                                            class="fa fa-refresh"></i>&nbsp;重置</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </form>


                                </div>


                                <div class="" id="toolbar1" role="group">
                                    <a class="btn btn-success" onclick="$.operate.add()"
                                       shiro:hasPermission="system:wzs:add">
                                        <i class="fa fa-plus"></i> 新建
                                    </a>

                                </div>
                                <div class="col-sm-12 select-table table-striped">
                                    <table id="bootstrap-table1"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="tab-2" class="tab-pane">
                    <div class="panel-body">
                        <div class="container-div">
                            <div class="row">
                                <div class="col-sm-12 search-collapse">
                                    <form id="formId2">
                                        <div class="select-list">
                                            <ul>

                                                <li>
                                                    <input type="text" placeholder="请输入要素名称" name="aCname"/>
                                                </li>

                                                <li>
                                                    <a class="btn btn-primary btn-rounded btn-sm"
                                                       onclick="$.table.search('formId2', 'bootstrap-table2')"><i
                                                            class="fa fa-search"></i>&nbsp;搜索</a>
                                                    <a class="btn btn-warning btn-rounded btn-sm"
                                                       onclick="$.form.reset('formId2', 'bootstrap-table2')"><i
                                                            class="fa fa-refresh"></i>&nbsp;重置</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </form>
                                </div>
                                <div class="" id="toolbar2" role="group">
                                    <a class="btn btn-success" onclick="$.operate.add()"
                                       shiro:hasPermission="system:wzs:add">
                                        <i class="fa fa-plus"></i> 新建
                                    </a>

                                </div>
                                <div class="col-sm-12 select-table table-striped">
                                    <table id="bootstrap-table2"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:wzs:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:wzs:remove')}]];
    var prefix = ctx + "system/wzs";

    $(function () {
        //破坏
        var options = {
            url: prefix + "/list?c_type=1",
            createUrl: prefix + "/add?c_type=1",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "完整性要素",
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            showSearch: false,
            id:'bootstrap-table1',
            formId:'formId1',
            toolbar:'toolbar1',
            columns: [{
                checkbox: true
            }, {
                title: "序号",
                formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }
            },

                {
                    field: 'aCname',
                    title: '要素名称'
                },
                {
                    field: 'aCweight',
                    title: '权重系数'
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.aCid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.aCid + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);

//盗窃/抢夺

        var options2 = {
            url: prefix + "/list?c_type=2",
            createUrl: prefix + "/add?c_type=2",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "完整性要素",
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            showSearch: false,
            id:'bootstrap-table2',
            formId:'formId2',
            toolbar:'toolbar2',
            columns: [{
                checkbox: true
            }, {
                title: "序号",
                formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }
            },

                {
                    field: 'aCname',
                    title: '要素名称'
                },
                {
                    field: 'aCweight',
                    title: '权重系数'
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.aCid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.aCid + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options2);
    });
</script>
</body>
</html>